<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8;" />
<title>Budget prévisionnel - ATENET.</title>
<style>
table, body {
	font-size: 9pt;
	font-family: Arial, Helvetica, sans-serif;
}
.lots {
	border-right: 1px solid #000;
	border-bottom: 1px solid #000;
}
.lots td, table th {
	border-left: 1px solid #000;
	border-top: 1px solid #000;
}

.break { 
     page-break-before: always; 
}
</style>
</head>

<body style="width: 185mm;">
<table style="width: 185mm;" cellspacing="0" cellpadding="4">
	<tr valign="top">
		<td style="width: 100mm; border: 1px solid #000;" rowspan="4">
			Syndic:
			<h2>{{ immeuble.syndic.name }}<br />
			{{ immeuble.syndic.adress }}</h2><br />
			Tel: {{ immeuble.syndic.phone }}<br />
			Fax: {{ immeuble.syndic.fax }}<br /><br />
			Email: {{ immeuble.syndic.email }}<br />
			Site internet: {{ immeuble.syndic.wwwsite }}
		</td>
		<td style="width: 5mm;">
		</td>
		<td align="center" style="width: 85mm; border: 1px solid #000;">
			<h2>Budget prévisionnel</h2>
			
		</td>
	</tr>
	<tr valign="top">
		<td></td>
		<td style="border-left: 1px solid #000; border-right: 1px solid #000; border-bottom: 1px solid #000;">
			Copropriete:<br />
			{{ immeuble.name }}<br />
			{{ immeuble.adress }}
		</td>
	</tr>
	<tr valign="top">
		<td></td>
		<td style="height: 5mm;">
		</td>
	</tr>
	<tr valign="top">
		<td></td>
		<td style="border: 1px solid #000;" valign="middle" align="center">
			<b>Exercice du {{ pc_current }}</b>
		</td>
	</tr>
	<tr valign="top">
		<td align="left"></td>
		<td></td>
		<td align="right">Le {{ todaydate|datetimeformat }}</td>
	</tr>
</table>

{% if budget_reg %}
<br /><b>Budget courant</b><br /><br />
<table class="lots" style="width: 185mm;" cellspacing="0" cellpadding="4">
	<tr valign="top">
		<th width="65mm">Intitules</th>
		<th width="26mm">Budget<br /><small>{{ pc_prev }}</small></th>
		<th width="26mm">Réel<br /><small>{{ pc_prev }}</small></th>
		<th width="26mm">Budget<br /><small>{{ pc_current }}</small></th>
		<th width="26mm">Réel<br /><small>{{ pc_current }}</small></th>
		<th width="26mm">Budget<br /><small>{{ pc_next }}</small></th>
	</tr>
	{% for bi in budget_reg  %}
	<tr valign="top" style="background-color: #CCC;">
		<td colspan='6'><b>{{ bi['charges_key'] }} </b></td>
	</tr>
	{% for exp in  bi['expenditures'] %}
	<tr valign="top" style="font-size: 7pt;">
		<td>{{ exp['expenditure'].code }} {{ exp['expenditure'].title }}</td>
		<td align="right">{% if exp['p_amount'] %} {{ exp['p_amount']|currencyformat }} {% else %} {{ exp['p_amount'] }} {% endif %}</td>
		<td></td>
		<td align="right">{% if exp['c_amount'] %} {{ exp['c_amount']|currencyformat }} {% else %} {{ exp['c_amount'] }} {% endif %}</td>
		<td ></td>
		<td align="right">{% if exp['n_amount'] %} {{ exp['n_amount']|currencyformat }} {% else %} {{ exp['n_amount'] }} {% endif %}</td>
	</tr>
    {% endfor %}
    <tr>
		<td><b>Total de la clé de {{ bi['charges_key'].name|lower }}</b></td>
		<td align="right">{{ bi['p_sum']|currencyformat }}</td>
		<td></td>
		<td align="right">{{ bi['c_sum']|currencyformat }}</td>
		<td ></td>
		<td  align="right">{{ bi['n_sum']|currencyformat }}</td>
    </tr>	
	{% endfor %}
    <tr>
		<td><b>Total général</b></td>
		<td align="right"><b>{{ budget_reg|sum(attribute='p_sum')|currencyformat }}</b></td>
		<td></td>
		<td align="right"><b>{{ budget_reg|sum(attribute='c_sum')|currencyformat }}</b></td>
		<td ></td>
		<td  align="right"><b>{{ budget_reg|sum(attribute='n_sum')|currencyformat }}</b></td>
    </tr>	
</table>
<br />
{% endif %}
{% if budget_add %}
<b>Budget sur travaux et opérations exceptionnelles</b><br /><br />
<table class="lots" style="width: 185mm;" cellspacing="0" cellpadding="4">
	<tr valign="top">
		<th width="65mm">Intitules</th>
		<th width="26mm">Budget<br /><small>{{ pc_prev }}</small></th>
		<th width="26mm">Réel<br /><small>{{ pc_prev }}</small></th>
		<th width="26mm">Budget<br /><small>{{ pc_current }}</small></th>
		<th width="26mm">Réel<br /><small>{{ pc_current }}</small></th>
		<th width="26mm">Budget<br /><small>{{ pc_next }}</small></th>
	</tr>
	{% for bi in budget_add  %}
	<tr valign="top" style="background-color: #CCC;">
		<td colspan='6'><b>{{ bi['charges_key'] }} </b></td>
	</tr>
	{% for exp in  bi['expenditures'] %}
	<tr valign="top" style="font-size: 7pt;">
		<td>{{ exp['expenditure'].code }} {{ exp['expenditure'].title }}</td>
		<td align="right">{% if exp['p_amount'] %} {{ exp['p_amount']|currencyformat }} {% else %} {{ exp['p_amount'] }} {% endif %}</td>
		<td></td>
		<td align="right">{% if exp['c_amount'] %} {{ exp['c_amount']|currencyformat }} {% else %} {{ exp['c_amount'] }} {% endif %}</td>
		<td ></td>
		<td align="right">{% if exp['n_amount'] %} {{ exp['n_amount']|currencyformat }} {% else %} {{ exp['n_amount'] }} {% endif %}</td>
	</tr>
    {% endfor %}
    <tr>
		<td><b>Total de la clé de {{ bi['charges_key'].name|lower }}</b></td>
		<td align="right">{{ bi['p_sum']|currencyformat }}</td>
		<td></td>
		<td align="right">{{ bi['c_sum']|currencyformat }}</td>
		<td ></td>
		<td  align="right">{{ bi['n_sum']|currencyformat }}</td>
    </tr>	
	{% endfor %}
    <tr>
		<td><b>Total général</b></td>
		<td align="right"><b>{{ budget_add|sum(attribute='p_sum')|currencyformat }}</b></td>
		<td></td>
		<td align="right"><b>{{ budget_add|sum(attribute='c_sum')|currencyformat }}</b></td>
		<td ></td>
		<td  align="right"><b>{{ budget_add|sum(attribute='n_sum')|currencyformat }}</b></td>
    </tr>	
</table>
<br />
{% endif %}

</body>
</html>